package com.example.service.webhook.controller;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.service.webhook.business.carrier.service.RepairService;

@RestController
@RequestMapping(value = "/api/v1")
public class RepairController {
    private static final Logger LOGGER = LoggerFactory.getLogger(RepairController.class);

    @Autowired
    private RepairService repairService;

    /**
     * 回调接口, moxie通过此endpoint通知账单更新和任务状态更新
     * 存入本地的mongo 
     */
    @RequestMapping(value = "/repair", method = RequestMethod.GET)
    public void notifyUpdateBill( ServletRequest request, ServletResponse response) {
    	
    	LOGGER.info("start repair t_mobilevoice");
    	repairService.repairVoiceCall();
    	
    }
}
